;;;
;;;
;;;	Author:
;;;		Henry C. Francis
;;;		425 N. Ashe St.
;;;		Southern Pines, NC 28387
;;;
;;;     http://paracadd.com
;;;	All rights reserved.
;;;
;;;Scaled block insertion routine (dimscale)
(DEFUN iblk_error (msg /)
  (IF msg
    (PRINC (STRCAT "\nERROR: " msg "\nIBLK cancelled! "))
    (PRINC "\nERROR: IBLK cancelled! ")
  )
  (IF oldiblk_osmode
    (SETVAR "osmode" oldiblk_osmode)
  )
  (SETQ *ERROR* oldiblk_error)
)
;;;****************************************************************************
(DEFUN c:iblk (/ pt1 inss1 bars)
  (SETQ oldiblk_error *ERROR*)
  (SETQ *ERROR* iblk_error)
  (SETQ oldiblk_osmode (GETVAR "osmode"))
  (SETVAR "osmode" 8)
  (LOAD "CLG5" "\nFile CLG5.LSP not loaded! ")
  (IF c:mklayr NIL (LOAD "MKLAYR" "\nFile MKLAYR.LSP not loaded! "))
  (c:svlayr)
  (SETVAR "cmdecho" 0)
  (SETQ cur_vtwst (GETVAR "viewtwist"))
  (IF dimscl
    nil
    (LOAD "dimscl")
  ) ;_ end of if
  (dimscl)
  (SETQ untwang (- 0 (* (/ cur_vtwst PI) 180)))
  (IF ustr NIL (LOAD "ustr" "\nFile USTR.LSP not loaded! "))
  (IF mlay NIL (LOAD "clg5" "\nFile CLG5.LSP not loaded! "))
  (IF pinit
    (PROGN
      (SETQ pinit (ustr 1 "\nEnter Engineer's Initials " pinit "T"))
      (SETQ bname (STRCAT pinit "_PE"))
    ) ;_ end of progn
    (IF dpfx
      nil
      (IF bars
        nil
        (SETQ bname (ustr 0 "Block Name " bname nil))
      ) ;_ end of if
    ) ;_ end of if
  ) ;_ end of if
  (IF (WCMATCH (STRCASE bname) "GPDGN_PROJECT_DATA,GPD")
    (SETQ bname "GPDGN_PROJECT_DATA")
  )
  (SETQ thisbname bname)
  (COND
        ((AND (SETQ thisblkdef (TBLSEARCH "BLOCK" thisbname))(SETQ bname (CDR (ASSOC 2 thisblkdef)))))
        ((SETQ cbname (FINDFILE (STRCAT thisbname ".dwg"))))
        ((SETQ cbname (FINDFILE (STRCAT (GETVAR "DWGPREFIX") "blocks\\" thisbname ".dwg"))))
  )
  (IF (OR cbname thisblkdef)
    (PROGN
      (SETQ disc_descr_list
              (LIST
                '("G" "General:")
                '("H" "Hazardous Materials:")
                '("V" "Survey / Mapping:")
                '("B" "Geotechnical:")
                '("C" "Civil:")
                '("L" "Landscape:")
                '("S" "Structural:")
                '("A" "Architectural:")
                '("I" "Interiors:")
                '("Q" "Equipment:")
                '("F" "Fire Protection:")
                '("P" "Plumbing:")
                '("D" "Process:")
                '("M" "Mechanical:")
                '("E" "Electrical:")
                '("T" "Telecommunications:")
                '("R" "Resource:")
                '("W" "Distributed Energy:")
                '("X" "Other Disciplines:")
                '("Z" "Contractor / Shop Drawings:")
                '("O" "Operations:")
                '("GI" "General Informational:")
                '("GC" "General Contractual:")
                '("GR" "General Resource:")
                '("HA" "Hazmat Asbestos:")
                '("HC" "Hazmat Chemicals:")
                '("HL" "Hazmat Lead:")
                '("HP" "Hazmat PCB:")
                '("HR" "Hazmat Refrigerants:")
                '("VA" "Aerial Survey:")
                '("VF" "Field Survey:")
                '("VI" "Digital Survey:")
                '("CD" "Civil Demolition:")
                '("CS" "Civil Site:")
                '("CG" "Civil Grading:")
                '("CP" "Civil Paving:")
                '("CI" "Civil Improvements:")
                '("CT" "Civil Transportation:")
                '("CU" "Civil Utilities:")
                '("LD" "Landscape Demolition:")
                '("LI" "Landscape Irrigation:")
                '("LP" "Landscape Planting:")
                '("SD" "Structural Demolition:")
                '("SS" "Structural Site:")
                '("SB" "Structural Substructure:")
                '("SF" "Structural Framing:")
                '("AS" "Architectural Site:")
                '("AD" "Architectural Demolition:")
                '("AE" "Architectural Elements:")
                '("AI" "Architectural Interiors:")
                '("AF" "Architectural Finishes:")
                '("AG" "Architectural Graphics:")
                '("ID" "Interior Demolition:")
                '("IN" "Interior Design:")
                '("IF" "Interior Furnishings:")
                '("IG" "Interior Graphics:")
                '("QA" "Athletic Equipment:")
                '("QB" "Bank Equipment:")
                '("QC" "Dry Cleaning Equipment:")
                '("QD" "Detention Equipment:")
                '("QE" "Educational Equipment:")
                '("QF" "Food service Equipment:")
                '("QH" "Hospital Equipment:")
                '("QL" "Laboratory Equipment:")
                '("QM" "Maintenance Equipment:")
                '("QP" "Parking Lot Equipment:")
                '("QR" "Retail Equipment:")
                '("QS" "Site Equipment:")
                '("QT" "Theatrical Equipment:")
                '("QV" "Video / Photographic Equipment:")
                '("QY" "Security Equipment:")
                '("FA" "Fire Detection and Alarm:")
                '("FX" "Fire Suppression:")
                '("PS" "Plumbing Site:")
                '("PD" "Plumbing Demolition:")
                '("PP" "Plumbing Piping:")
                '("PQ" "Plumbing Equipment:")
                '("DS" "Process Site:")
                '("DD" "Process Demolition:")
                '("DL" "Process Liquids:")
                '("DG" "Process Gases:")
                '("DP" "Process Piping:")
                '("DQ" "Process Equipment:")
                '("DE" "Process Electrical:")
                '("DI" "Process Instrumentation:")
                '("DW" "Process Waters:")
                '("DC" "Process Chemicals:")
                '("DA" "Process Airs:")
                '("DX" "Process Exhaust:")
                '("DR" "Process Drains and Reclaims:")
                '("DM" "Process HPM Gases:")
                '("DY" "Process Slurry:")
                '("DO" "Process Oils:")
                '("DV" "Process Vacuum:")
                '("MS" "Mechanical Site:")
                '("MD" "Mechanical Demolition:")
                '("MH" "Mechanical HVAC:")
                '("MP" "Mechanical Piping:")
                '("MI" "Mechanical Instrumentation:")
                '("ES" "Electrical Site:")
                '("ED" "Electrical Demolition:")
                '("EP" "Electrical Power:")
                '("EL" "Electrical Lighting:")
                '("EI" "Electrical Instrumentation:")
                '("ET" "Electrical Telecommunications:")
                '("EY" "Electrical Auxiliary Systems:")
                '("TA" "Telecom Audio Visual:")
                '("TC" "Telecom Clock and Program:")
                '("TI" "Telecom Intercom:")
                '("TM" "Telecom Monitoring:")
                '("TN" "Telecom Data Networks:")
                '("TT" "Telecom Telephone:")
                '("TY" "Telecom Security:")
                '("RC" "Resource Civil:")
                '("RS" "Resource Structural:")
                '("RA" "Resource Architectural:")
                '("RM" "Resource Mechanical:")
                '("RE" "Resource Electrical:")
               ) ;_ end of LIST
          )
      (COND
        ((OR
           (WCMATCH (STRCASE bname) "BARN")
           (WCMATCH (STRCASE bname) "BUILDING")
           (WCMATCH (STRCASE bname) "BUSINESS")
           (WCMATCH (STRCASE bname) "CHURCH")
           (WCMATCH (STRCASE bname) "GARAGE")
           (WCMATCH (STRCASE bname) "HOUSE")
           (WCMATCH (STRCASE bname) "STORE")
           (WCMATCH (STRCASE bname) "TRAILER")
         )
         (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "BLDG"
               clg5_minor1 ""
               clg5_minor2 ""
               clg5_user ""
               clg5_status ""
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Buildings and primary structures"
               minor1_txt nil
               minor2_txt nil
               user_txt nil
               status_txt nil
               clg5_minor1
                (COND
                  ((WCMATCH (STRCASE bname) "BARN")"BARN")
                  ((WCMATCH (STRCASE bname) "BUILDING")"OTHR")
                  ((WCMATCH (STRCASE bname) "BUSINESS")"BUSI")
                  ((WCMATCH (STRCASE bname) "CHURCH")"HOLY")
                  ((WCMATCH (STRCASE bname) "GARAGE")"CARS")
                  ((WCMATCH (STRCASE bname) "HOUSE")"HOUS")
                  ((WCMATCH (STRCASE bname) "STORE")"SHOP")
                  ((WCMATCH (STRCASE bname) "TRAILER")"TRLR")
                )
               minor1_txt 
                (COND
                  ((WCMATCH (STRCASE bname) "BARN")"Barns")
                  ((WCMATCH (STRCASE bname) "BUILDING")"Other")
                  ((WCMATCH (STRCASE bname) "BUSINESS")"Businesses")
                  ((WCMATCH (STRCASE bname) "CHURCH")"Churches")
                  ((WCMATCH (STRCASE bname) "GARAGE")"Garages")
                  ((WCMATCH (STRCASE bname) "HOUSE")"Houses")
                  ((WCMATCH (STRCASE bname) "STORE")"Stores")
                  ((WCMATCH (STRCASE bname) "TRAILER")"Trailers")
                )
               rotate_finish T
               scale_finish NIL
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1)
               sel_clg5_color "6"
               ltname "Continuous"
         )
         (clg5_mlay))
        ((WCMATCH (STRCASE bname) "GPDGN_PROJECT_DATA")
         (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "DATA"
               clg5_minor1 "NPLT"
               clg5_minor2 ""
               clg5_user ""
               clg5_status ""
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "GPDGN project data"
               minor1_txt nil
               minor2_txt nil
               user_txt nil
               status_txt nil
               clg5_minor1 "NPLT"
               minor1_txt "Not For Plotting"
               rotate_finish T
               scale_finish T
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1)
               sel_clg5_color "6"
               ltname "Continuous"
         )
         (clg5_mlay))
        ((WCMATCH (STRCASE bname) "WELL")
         (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "WATR"
               clg5_minor1 "WELL"
               clg5_minor2 ""
               clg5_user ""
               clg5_status "E"
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Water supply"
               minor1_txt "Wells"
               minor2_txt nil
               user_txt nil
               status_txt "Existing to remain"
               rotate_finish NIL
               scale_finish NIL
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1 "-" clg5_status)
               sel_clg5_color "7"
               ltname "Continuous"
         )
         (clg5_mlay))
        ((OR (WCMATCH (STRCASE bname) "XFH")(WCMATCH (STRCASE bname) "F*HYD*"))
         (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "FIRE"
               clg5_minor1 "HYDR"
               clg5_minor2 ""
               clg5_user ""
               clg5_status "E"
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Fire protection system"
               minor1_txt "Hydrants"
               minor2_txt nil
               user_txt nil
               status_txt "Existing to remain"
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1 "-" clg5_status)
               sel_clg5_color "5"
               ltname "Continuous"
               rotate_finish T
               scale_finish NIL
         )
         (clg5_mlay))
        ((OR (WCMATCH (STRCASE bname) "WM")(WCMATCH (STRCASE bname) "W*METER"))
         (IF (WCMATCH (STRCASE bname) "WM")
           NIL
           (SETQ bname "WM")
         )
         (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "WATR"
               clg5_minor1 "METR"
               clg5_minor2 ""
               clg5_user ""
               clg5_status "E"
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Water supply"
               minor1_txt "Meters"
               minor2_txt nil
               user_txt nil
               status_txt "Existing to remain"
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1 "-" clg5_status)
               sel_clg5_color "5"
               ltname "Continuous"
               rotate_finish NIL
               scale_finish NIL
         )
         (clg5_mlay))
        ((OR (WCMATCH (STRCASE bname) "WV")(WCMATCH (STRCASE bname) "W*VALVE"))
         (IF (WCMATCH (STRCASE bname) "WV")
           NIL
           (SETQ bname "WV")
         )
         (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "WATR"
               clg5_minor1 "VALV"
               clg5_minor2 ""
               clg5_user ""
               clg5_status "E"
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Water supply"
               minor1_txt "Valves"
               minor2_txt nil
               user_txt nil
               status_txt "Existing to remain"
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1 "-" clg5_status)
               sel_clg5_color "5"
               ltname "Continuous"
               rotate_finish T
               scale_finish NIL
         )
         (clg5_mlay))
        ((OR (WCMATCH (STRCASE bname) "STA")(WCMATCH (STRCASE bname) "NAIL"))
         (IF (WCMATCH (STRCASE bname) "STA")
           NIL
           (SETQ bname "STA")
         )
         (SETQ origbn bname
               clg5_discipline "V"
               clg5_major "CTRL"
               clg5_minor1 "TRAV"
               clg5_minor2 ""
               clg5_user ""
               clg5_status ""
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Control points"
               minor1_txt "Traverse"
               minor2_txt nil
               user_txt nil
               status_txt nil
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1)
               sel_clg5_color "1"
               ltname "Continuous"
               rotate_finish NIL
               scale_finish NIL
         )
         (clg5_mlay))
        ((OR (WCMATCH (STRCASE bname) "TPED")(WCMATCH (STRCASE bname) "TELPED")(WCMATCH (STRCASE bname) "TEL*PED*"))
         (IF (WCMATCH (STRCASE bname) "TPED")
           NIL
           (SETQ bname "TPED")
         )
         (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "COMM"
               clg5_minor1 "EQPM"
               clg5_minor2 "TELE"
               clg5_user ""
               clg5_status "E"
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Communication"
               minor1_txt "Equipment"
               minor2_txt"Telephone"
               user_txt nil
               status_txt "Existing to remain"
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1 "-" clg5_minor2 "-" clg5_status)
               sel_clg5_color "6"
               ltname "Continuous"
               rotate_finish NIL
               scale_finish NIL
         )
         (clg5_mlay))
        ((OR (WCMATCH (STRCASE bname) "CABLETVPED")(WCMATCH (STRCASE bname) "CATVPED")(WCMATCH (STRCASE bname) "TVPED")(WCMATCH (STRCASE bname) "CATV")(WCMATCH (STRCASE bname) "CABL*"))
         (IF (WCMATCH (STRCASE bname) "CABLETVPED")
           NIL
           (SETQ bname "CABLETVPED")
         )
         (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "CATV"
               clg5_minor1 "EQPM"
               clg5_minor2 ""
               clg5_user ""
               clg5_status "E"
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Cable TV"
               minor1_txt "Equipment"
               minor2_txt nil
               user_txt nil
               status_txt "Existing to remain"
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1 "-" clg5_status)
               sel_clg5_color "6"
               rotate_finish NIL
               scale_finish NIL
         )
         (clg5_mlay))
        ((OR (WCMATCH (STRCASE bname) "FIBEROPTICPED")(WCMATCH (STRCASE bname) "FOPED")(WCMATCH (STRCASE bname) "FOP"))
         (IF (WCMATCH (STRCASE bname) "FIBEROPTICPED")
           NIL
           (SETQ bname "FIBEROPTICPED")
         )
         (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "COMM"
               clg5_minor1 "EQPM"
               clg5_minor2 "FIBR"
               clg5_user ""
               clg5_status "E"
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Communications"
               minor1_txt "Equipment"
               minor2_txt "Fiber optics"
               user_txt nil
               status_txt "Existing to remain"
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1 "-" clg5_minor2 "-" clg5_status)
               sel_clg5_color "6"
               rotate_finish NIL
               scale_finish NIL
         )
         (clg5_mlay))
        ((OR (WCMATCH (STRCASE bname) "U_POLE")(WCMATCH (STRCASE bname) "PP")(WCMATCH (STRCASE bname) "POWERPOLE"))
         (IF (WCMATCH (STRCASE bname) "U_POLE")
           NIL
           (SETQ bname "U_POLE")
         )
         (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "POWR"
               clg5_minor1 "POLE"
               clg5_minor2 ""
               clg5_user ""
               clg5_status "E"
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Power"
               minor1_txt "Pole"
               minor2_txt nil
               user_txt nil
               status_txt "Existing to remain"
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1 "-" clg5_status)
               sel_clg5_color "6"
               rotate_finish NIL
               scale_finish NIL
         )
         (clg5_mlay))
        ((OR (WCMATCH (STRCASE bname) "LUMIN")(WCMATCH (STRCASE bname) "LP")(WCMATCH (STRCASE bname) "LIGHTPOLE")(WCMATCH (STRCASE bname) "L*POLE"))
         (IF (WCMATCH (STRCASE bname) "LUMIN")
           NIL
           (SETQ bname "LUMIN")
         )
         (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "POWR"
               clg5_minor1 "LITE"
               clg5_minor2 "POLE"
               clg5_user ""
               clg5_status "E"
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Power"
               minor1_txt "Light"
               minor2_txt "Pole"
               user_txt nil
               status_txt "Existing to remain"
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1 "-" clg5_minor2 "-" clg5_status)
               sel_clg5_color "6"
               rotate_finish NIL
               scale_finish NIL
         )
         (clg5_mlay))
        ((OR (WCMATCH (STRCASE bname) "G_POLE")(WCMATCH (STRCASE bname) "GUYPOLE"))
         (IF (WCMATCH (STRCASE bname) "G_POLE")
           NIL
           (SETQ bname "G_POLE")
         )
         (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "POWR"
               clg5_minor1 "DGUY"
               clg5_minor2 "POLE"
               clg5_user ""
               clg5_status "E"
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Power"
               minor1_txt "Guy"
               minor2_txt "Pole"
               user_txt nil
               status_txt "Existing to remain"
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1 "-" clg5_minor2 "-" clg5_status)
               sel_clg5_color "6"
               rotate_finish T
               scale_finish NIL
         )
         (clg5_mlay))
        ((OR (WCMATCH (STRCASE bname) "GUYWIRE")(WCMATCH (STRCASE bname) "GW")(WCMATCH (STRCASE bname) "GUY"))
         (IF (WCMATCH (STRCASE bname) "GUYWIRE")
           NIL
           (SETQ bname "GUYWIRE")
         )
         (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "POWR"
               clg5_minor1 "DGUY"
               clg5_minor2 "WIRE"
               clg5_user ""
               clg5_status "E"
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Power"
               minor1_txt "Guy"
               minor2_txt "Wire"
               user_txt nil
               status_txt "Existing to remain"
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1 "-" clg5_minor2 "-" clg5_status)
               sel_clg5_color "6"
               rotate_finish T
               scale_finish NIL
         )
         (clg5_mlay))
        ((OR (WCMATCH (STRCASE bname) "MBOX")(WCMATCH (STRCASE bname) "MB")(WCMATCH (STRCASE bname) "MAILBOX"))
         (IF (WCMATCH (STRCASE bname) "MBOX")
           NIL
           (SETQ bname "MBOX")
         )
         (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "MAIL"
               clg5_minor1 "BOXS"
               clg5_minor2 ""
               clg5_user ""
               clg5_status "E"
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Mail"
               minor1_txt "Boxes"
               minor2_txt nil
               user_txt nil
               status_txt "Existing to remain"
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1 "-" clg5_status)
               sel_clg5_color "6"
               rotate_finish T
               scale_finish NIL
         )
         (clg5_mlay))
        ((OR (WCMATCH (STRCASE bname) "SHRUB*")(WCMATCH (STRCASE bname) "BUSH"))
         (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "PLNT"
               clg5_minor1 "BUSH"
               clg5_minor2 ""
               clg5_user ""
               clg5_status "E"
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Plant material"
               minor1_txt "Bushes"
               minor2_txt nil
               user_txt nil
               status_txt "Existing to remain"
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1 "-" clg5_status)
               sel_clg5_color "1"
               rotate_finish NIL
               scale_finish T
         )
         (clg5_mlay))
        ((WCMATCH (STRCASE bname) "CG_T##")
         (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "PLNT"
               clg5_minor1 "TREE"
               clg5_minor2 ""
               clg5_user ""
               clg5_status "E"
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Plant material"
               minor1_txt "Trees"
               minor2_txt nil
               user_txt nil
               status_txt "Existing to remain"
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1 "-" clg5_status)
               sel_clg5_color "1"
               rotate_finish NIL
               scale_finish T
         )
         (clg5_mlay))
        ((OR (WCMATCH (STRCASE bname) "I[PR]")(WCMATCH (STRCASE bname) "EI[PR]"))
         (IF (WCMATCH (STRCASE bname) "IP")
           NIL
           (SETQ bname "IP")
         )
         (SETQ origbn bname
               clg5_discipline "V"
               clg5_major "PROP"
               clg5_minor1 "MRKR"
               clg5_minor2 ""
               clg5_user ""
               clg5_status "E"
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Property boundary"
               minor1_txt "Marker"
               minor2_txt nil
               user_txt nil
               status_txt "Existing to remain"
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1 "-" clg5_status)
               sel_clg5_color "7"
               rotate_finish NIL
               scale_finish NIL
         )
         (clg5_mlay))
        ((WCMATCH (STRCASE bname) "RWMON,ROW-MON")
         (IF (WCMATCH (STRCASE bname) "RWMON")
           NIL
           (SETQ bname "RWMON")
         )
         (SETQ origbn bname
               clg5_discipline "V"
               clg5_major "PROP"
               clg5_minor1 "RWAY"
               clg5_minor2 "MRKR"
               clg5_user ""
               clg5_status "E"
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Property boundary"
               minor1_txt "Right-of-Way"
               minor2_txt "Marker"
               user_txt nil
               status_txt "Existing to remain"
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1 "-" clg5_minor2 "-" clg5_status)
               sel_clg5_color "7"
               rotate_finish NIL
               scale_finish NIL
         )
         (clg5_mlay))
        ((OR (WCMATCH (STRCASE bname) "FOMARKER")(WCMATCH (STRCASE bname) "FO")(WCMATCH (STRCASE bname) "*SIGN*"))
         (IF (WCMATCH (STRCASE bname) "SIGN1")
           NIL
           (SETQ bname "SIGN1")
         )
         (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "COMM"
               clg5_minor1 "FIBR"
               clg5_minor2 "MRKR"
               clg5_user ""
               clg5_status "E"
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Communications"
               minor1_txt "Fiber optics"
               minor2_txt "Marker"
               user_txt nil
               status_txt "Existing to remain"
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1 "-" clg5_minor2 "-" clg5_status)
               sel_clg5_color "7"
               rotate_finish T
               scale_finish NIL
          )
         (clg5_mlay))
        ((WCMATCH (STRCASE bname) "*POST*")
         (IF ukword NIL (LOAD "ukword" "\nFile UKWORD.LSP not loaded! "))
         (SETQ post-type (ukword 1 "Corner Fence Gate Unknown" "Post type? [Corner/Fence/Gate/Unknown]" (IF post-type post-type "Gate")))
         (SETQ origbn bname)
         (SETQ bname (IF (AND
                           (WCMATCH (STRCASE bname) "*POST*")
                           (OR
                             (TBLSEARCH "BLOCK" bname)
                             (FINDFILE (STRCAT bname ".dwg"))
                           )
                         )
                       bname
                       "POST"
                     )
         )
         (SETQ clg5_discipline "C"
               clg5_major "FENC"
               clg5_minor1 "POST"
               clg5_minor2 (SUBSTR (STRCASE post-type) 1 4)
               clg5_user ""
               clg5_status "E"
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Posts"
               minor1_txt nil
               minor2_txt nil
               user_txt nil
               status_txt "Existing to remain"
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1 "-" clg5_minor2 "-" clg5_status)
               sel_clg5_color "7"
               rotate_finish NIL
               scale_finish NIL
          )
         (clg5_mlay))
        ((WCMATCH (STRCASE bname) "*SIGN*")
         (IF (WCMATCH (STRCASE bname) "SIGN1")
           NIL
           (SETQ bname "SIGN1")
         )
         (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "SIGN"
               clg5_minor1 ""
               clg5_minor2 ""
               clg5_user ""
               clg5_status "E"
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Signage"
               minor1_txt nil
               minor2_txt nil
               user_txt nil
               status_txt "Existing to remain"
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_status)
               sel_clg5_color "7"
               rotate_finish T
               scale_finish NIL
          )
         (clg5_mlay))
        ((WCMATCH (STRCASE bname) "RWSIGN")
         (IF (WCMATCH (STRCASE bname) "SIGN1")
           NIL
           (SETQ bname "SIGN1")
         )
          (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "SIGN"
               clg5_minor1 "RWAY"
               clg5_minor2 ""
               clg5_user ""
               clg5_status "E"
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Signage"
               minor1_txt "Right-of-Way"
               minor2_txt nil
               user_txt nil
               status_txt "Existing to remain"
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1 "-" clg5_status)
               sel_clg5_color "7"
               rotate_finish T
               scale_finish NIL
          )
          (SETQ bname "SIGN1")
         (clg5_mlay))
        ((WCMATCH (STRCASE bname) "*_PE")
         (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "SEAL"
               clg5_minor1 "ENGR"
               clg5_minor2 ""
               clg5_user ""
               clg5_status ""
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Seals"
               minor1_txt "Engineer"
               minor2_txt nil
               user_txt nil
               status_txt nil
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1)
               sel_clg5_color "7"
               rotate_finish T
               scale_finish NIL
        )
         (clg5_mlay))
        ((WCMATCH (STRCASE bname) "MH_EX")
         (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "SSWR"
               clg5_minor1 "STRC"
               clg5_minor2 ""
               clg5_user ""
               clg5_status ""
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Sanitary Sewer"
               minor1_txt "structures"
               minor2_txt nil
               user_txt nil
               status_txt nil
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1)
               sel_clg5_color "3"
               rotate_finish NIL
               scale_finish NIL
        )
         (clg5_mlay))
        ((WCMATCH (STRCASE bname) "CO")
         (SETQ origbn bname
               clg5_discipline "C"
               clg5_major "SSWR"
               clg5_minor1 "CLEN"
               clg5_minor2 "OUTS"
               clg5_user ""
               clg5_status ""
               discipline_txt (CADR (ASSOC clg5_discipline disc_descr_list))
               major_txt "Sanitary Sewer"
               minor1_txt "cleanouts"
               minor2_txt nil
               user_txt nil
               status_txt nil
               clg5lay (STRCAT clg5_discipline "-" clg5_major "-" clg5_minor1)
               sel_clg5_color "3"
               rotate_finish NIL
               scale_finish NIL
        )
         (clg5_mlay))
      )
      (IF ukword NIL (LOAD "ukword" "\nFile UKWORD.LSP not loaded! "))
      (IF (OR (EQ (GETVAR "tilemode") 0) (AND (EQ (GETVAR "tilemode") 1) (EQ (GETVAR "dimscale") 1.0)))
        (SETQ scale_ref (ukword 1 "Viewport 1x Specify" "[Viewport scale/1x/Specify scale]" (if scale_ref scale_ref "1x")))
        (SETQ scale_ref "Specify")
      )
      (COND
	((EQ scale_ref "Viewport")
	 (SETQ inss1 (atof (rtos (dimscl)2 2))))
	((EQ scale_ref "1x")
	 (SETQ inss1 1.0))
	((AND (EQ scale_ref "Specify")(EQ (GETVAR "tilemode") 1)(NOT (EQ (GETVAR "dimscale") 1.0)))
	 (SETQ inss1 (GETVAR "dimscale")))
	((EQ scale_ref "Specify")
	 (SETQ inss1 (ureal 1 "" "Enter scale: " (IF inss1 inss1 1.0))))
      )
      (IF upoint nil (load "upoint" "\nFile UPOINT.LSP not loaded! "))
      (SETQ pt1 (upoint 1 "" "Insertion Point" '(0.0 0.0 0.0) nil))
      (SETQ pt1 (LIST (CAR pt1) (CADR pt1) 0));(* dimsc 1001)
      (IF thisblkdef
        (IF (WCMATCH (STRCASE bname) "GPDGN_PROJECT_DATA")
          (COMMAND ".insert" bname pt1 (IF scale_finish 1.0 inss1)(IF rotate_finish pause untwang))
          (COMMAND ".insert" bname pt1 (IF scale_finish 1.0 inss1)(IF scale_finish 1.0 inss1)(IF rotate_finish pause untwang))
        )
        (COMMAND ".insert" (STRCAT bname "=" cbname) pt1 (IF scale_finish 1.0 inss1)(IF scale_finish 1.0 inss1)(IF rotate_finish pause untwang))
      )
      (IF scale_finish
        (COMMAND ".scale" (ENTLAST) "" pt1 pause)
      )
;;;      (IF rotate_finish
;;;        (COMMAND ".rotate" (ENTLAST) "" pt1 pause)
;;;      )
      (IF origbn
        (SETQ bname origbn)
      )
      (IF set-this-anno-scale NIL (LOAD "set-this-anno-scale" "\nFile SET-THIS-ANNO-SCALE.LSP not loaded! "))
      (set-this-anno-scale (entlast))
    ) ;_ end of progn
    (COND
      ((AND bname cbname)
        (PROMPT (STRCAT "\nBlock " bname " or File " cbname " not found! \n")))
      ((AND bname)
        (PROMPT (STRCAT "\nBlock " bname " not found! \n")))
      ((AND cbname)
        (PROMPT (STRCAT "\nFile " cbname " not found! \n")))
    )
  ) ;_ end of if
  (PROGN
    (SETQ pinit nil
          dpfx nil
          bars nil
    ) ;_ end of setq
  ) ;_ end of progn
  (SETVAR "cmdecho" 1)
  (c:rslayr)
  (IF oldiblk_osmode
    (SETVAR "osmode" oldiblk_osmode)
  )
  (SETQ *ERROR* oldiblk_error)
  (PRINC)
) ;_ end of DEFUN
;;;****************************************************************************
(DEFUN c:nope ()(SETQ pinit nil)(PRINC))
(DEFUN C:MH ()(SETQ bname "MH_EX")(C:IBLK)(PRINC))
(DEFUN C:WM ()(SETQ bname "WM")(C:IBLK)(PRINC))
(DEFUN C:TPED () (SETQ bname "TPED")(C:IBLK)(PRINC))
(DEFUN C:CATV () (SETQ bname "CABLETVPED")(C:IBLK)(PRINC))
(DEFUN C:FOPED () (SETQ bname "FIBEROPTICPED")(C:IBLK)(PRINC))
(DEFUN C:PP () (SETQ bname "U_POLE")(C:IBLK)(PRINC))
(DEFUN C:LP () (SETQ bname "LUMIN")(C:IBLK)(PRINC))
(DEFUN C:GP () (SETQ bname "G_POLE")(C:IBLK)(PRINC))
(DEFUN C:GW () (SETQ bname "GUYWIRE")(C:IBLK)(PRINC))
(DEFUN C:MB () (SETQ bname "MBOX")(C:IBLK)(PRINC))
(DEFUN C:IP () (SETQ bname "IP")(C:IBLK)(PRINC))
(DEFUN C:SIGN () (SETQ bname "SIGN1")(C:IBLK)(PRINC))
(DEFUN C:RWSIGN () (SETQ bname "RWSIGN")(C:IBLK)(PRINC))
(DEFUN C:RWMON () (SETQ bname "RWMON")(C:IBLK)(PRINC))
(DEFUN C:FOSIGN () (SETQ bname "FOSIGN")(C:IBLK)(PRINC))
